package course.po;

import java.io.Serializable;

public class Course implements Comparable<Object>, Serializable {
	private static final long serialVersionUID = 3606184640186182044L;
	private int couId;
	private String couType;
	private String couNo;
	private String couName;
	private String couDetail;
	private int couCredit;
	private int maxNumber;
	private int selectNumber;
	private Teacher teacher;

	public Course() {
		super();
	}

	public Course(int couId, String couType, String couNo, String couName, String couDetail, int couCredit,
			int maxNumber, int selectNumber, Teacher teacher) {
		super();
		this.couId = couId;
		this.couType = couType;
		this.couNo = couNo;
		this.couName = couName;
		this.couDetail = couDetail;
		this.couCredit = couCredit;

		this.maxNumber = maxNumber;
		this.selectNumber = selectNumber;
		this.teacher = teacher;
	}

	public Course(int couId, String couName) {
		super();
		this.couId = couId;
		this.couName = couName;

	}

	@Override
	public String toString() {
		return "Course [编号:" + couId + ", 开课学年和学期:" + couType + ", 课程号:" + couNo + ", 课程名:" + couName + ", 时间/地点:"
				+ couDetail + ", 学分:" + couCredit + ", 课程容量:" + maxNumber + ", 已选人数:" + selectNumber + ", 授课老师:"
				+ teacher + "]";
	}

	public int compareTo(Object object) {
		Course bk = (Course) object;
		int difference = (int) ((this.getCouId() - bk.getCouId()) * 10000);
		return difference;
	}

	public int getCouId() {
		return couId;
	}

	public void setCouId(int couId) {
		this.couId = couId;
	}

	public String getCouType() {
		return couType;
	}

	public void setCouType(String couType) {
		this.couType = couType;
	}

	public String getCouNo() {
		return couNo;
	}

	public void setCouNo(String couNo) {
		this.couNo = couNo;
	}

	public String getCouName() {
		return couName;
	}

	public void setCouName(String couName) {
		this.couName = couName;
	}

	public String getCouDetail() {
		return couDetail;
	}

	public void setCouDetail(String couDetail) {
		this.couDetail = couDetail;
	}

	public int getCouCredit() {
		return couCredit;
	}

	public void setCouCredit(int couCredit) {
		this.couCredit = couCredit;
	}

	public int getMaxNumber() {
		return maxNumber;
	}

	public void setMaxNumber(int maxNumber) {
		this.maxNumber = maxNumber;
	}

	public int getSelectNumber() {
		return selectNumber;
	}

	public void setSelectNumber(int selectNumber) {
		this.selectNumber = selectNumber;
	}

	public Teacher getTeacher() {
		return teacher;
	}

	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}

}
